package com.xiantian.oss;


import com.aliyun.oss.model.CannedAccessControlList;
import com.aliyun.oss.model.PutObjectResult;

import java.io.FileInputStream;
import java.io.FileNotFoundException;

public class OssUtils {
    public static final AliYunOssUtils utils = new AliYunOssUtils(new AliYunOssConfig(){
        {
            setAccessKeyId("LTAI5tAukNuDu4S37HgW1TPG");
            setAccessKeySecret("z4cdcPpEdFBQDPJ4aD4ONgFQUpFZWU");
            setEndpoint("https://oss-cn-hangzhou.aliyuncs.com");
            setBucketName("hua-yi");
        }
    });

//    public static void main(String[] args) throws FileNotFoundException {
//
//
//
//        PutObjectResult put = utils.put("tmp/1.jpg", new FileInputStream("D:\\upload/1.jpg"), CannedAccessControlList.PublicRead);
//
//        //http://oss.hua-yi.lishuidingtalk.com/tmp/1.jpg
//    }

}
